package com.xbongbong.pro.enums.permission.enums;

import com.xbongbong.i18n.util.I18nMessageUtil;
import com.xbongbong.saas.enums.XbbRefTypeEnum;
import lombok.Getter;

import java.util.Objects;

@Getter
public enum FileCabinetVisiblePermissionEnum {

    CUS_FILE_CABINET_VISIBLE(XbbRefTypeEnum.CUSTOMER_MANAGEMENT.getCode(), ProPermissionAliasEnum.CUS_FILE_CABINET_VISIBLE.getAlias(), ProPermissionAliasEnum.CUS_FILE_CABINET_VISIBLE.getI18nMemo()),

    OPP_FILE_CABINET_VISIBLE(XbbRefTypeEnum.SALES_OPPORTUNITY.getCode(), ProPermissionAliasEnum.OPP_FILE_CABINET_VISIBLE.getAlias(), ProPermissionAliasEnum.OPP_FILE_CABINET_VISIBLE.getI18nMemo()),

    CUS_COM_FILE_CABINET_VISIBLE(XbbRefTypeEnum.CUSTOMER_COMMUNICATE.getCode(), ProPermissionAliasEnum.CUS_COM_FILE_CABINET_VISIBLE.getAlias(), ProPermissionAliasEnum.CUS_COM_FILE_CABINET_VISIBLE.getI18nMemo()),

    CONTRACT_FILE_CABINET_VISIBLE(XbbRefTypeEnum.CONTRACT.getCode(), ProPermissionAliasEnum.CONTRACT_FILE_CABINET_VISIBLE.getAlias(), ProPermissionAliasEnum.CONTRACT_FILE_CABINET_VISIBLE.getI18nMemo()),

    CONTACT_FILE_CABINET_VISIBLE(XbbRefTypeEnum.CONTACT.getCode(), ProPermissionAliasEnum.CONTACT_FILE_CABINET_VISIBLE.getAlias(), ProPermissionAliasEnum.CONTACT_FILE_CABINET_VISIBLE.getI18nMemo()),

    WORK_REPORT_FILE_CABINET_VISIBLE(XbbRefTypeEnum.WORK_REPORT.getCode(), ProPermissionAliasEnum.WORK_REPORT_FILE_CABINET_VISIBLE.getAlias(), ProPermissionAliasEnum.WORK_REPORT_FILE_CABINET_VISIBLE.getI18nMemo()),

    PURCHASE_FILE_CABINET_VISIBLE(XbbRefTypeEnum.PURCHASE.getCode(), ProPermissionAliasEnum.PURCHASE_FILE_CABINET_VISIBLE.getAlias(), ProPermissionAliasEnum.PURCHASE_FILE_CABINET_VISIBLE.getI18nMemo()),

    SUPPLIER_FILE_CABINET_VISIBLE(XbbRefTypeEnum.SUPPLIER.getCode(), ProPermissionAliasEnum.SUPPLIER_FILE_CABINET_VISIBLE.getAlias(), ProPermissionAliasEnum.SUPPLIER_FILE_CABINET_VISIBLE.getI18nMemo()),

    INSTOCK_FILE_CABINET_VISIBLE(XbbRefTypeEnum.OTHER_INSTOCK.getCode(), ProPermissionAliasEnum.INSTOCK_FILE_CABINET_VISIBLE.getAlias(), ProPermissionAliasEnum.INSTOCK_FILE_CABINET_VISIBLE.getI18nMemo()),

    PUINSTOCK_FILE_CABINET_VISIBLE(XbbRefTypeEnum.PURCHASE_INSTOCK.getCode(), ProPermissionAliasEnum.PUINSTOCK_FILE_CABINET_VISIBLE.getAlias(),ProPermissionAliasEnum.PUINSTOCK_FILE_CABINET_VISIBLE.getI18nMemo()),

    REINSTOCK_FILE_CABINET_VISIBLE(XbbRefTypeEnum.REFUND_INSTOCK.getCode(), ProPermissionAliasEnum.REINSTOCK_FILE_CABINET_VISIBLE.getAlias(),ProPermissionAliasEnum.REINSTOCK_FILE_CABINET_VISIBLE.getI18nMemo()),

    PRINSTOCK_FILE_CABINET_VISIBLE(XbbRefTypeEnum.PRODUCTION_INSTOCK.getCode(), ProPermissionAliasEnum.PRINSTOCK_FILE_CABINET_VISIBLE.getAlias(),ProPermissionAliasEnum.PRINSTOCK_FILE_CABINET_VISIBLE.getI18nMemo()),

    RMINSTOCK_FILE_CABINET_VISIBLE(XbbRefTypeEnum.RETURNED_MATERIEL_INSTOCK.getCode(), ProPermissionAliasEnum.RMINSTOCK_FILE_CABINET_VISIBLE.getAlias(),ProPermissionAliasEnum.RMINSTOCK_FILE_CABINET_VISIBLE.getI18nMemo()),

    OUTSTOCK_FILE_CABINET_VISIBLE(XbbRefTypeEnum.OTHER_OUTSTOCK.getCode(), ProPermissionAliasEnum.OUTSTOCK_FILE_CABINET_VISIBLE.getAlias(), ProPermissionAliasEnum.OUTSTOCK_FILE_CABINET_VISIBLE.getI18nMemo()),

    COOUTSTOCK_FILE_CABINET_VISIBLE(XbbRefTypeEnum.CONTRACT_OUTSTOCK.getCode(), ProPermissionAliasEnum.COOUTSTOCK_FILE_CABINET_VISIBLE.getAlias(),ProPermissionAliasEnum.COOUTSTOCK_FILE_CABINET_VISIBLE.getI18nMemo()),

    WOOUTSTOCK_FILE_CABINET_VISIBLE(XbbRefTypeEnum.WORK_ORDER_OUTSTOCK.getCode(), ProPermissionAliasEnum.WOOUTSTOCK_FILE_CABINET_VISIBLE.getAlias(),ProPermissionAliasEnum.WOOUTSTOCK_FILE_CABINET_VISIBLE.getI18nMemo()),

    PMOUTSTOCK_FILE_CABINET_VISIBLE(XbbRefTypeEnum.PRODUCTION_MATERIEL_OUTSTOCK.getCode(), ProPermissionAliasEnum.PMOUTSTOCK_FILE_CABINET_VISIBLE.getAlias(),ProPermissionAliasEnum.PMOUTSTOCK_FILE_CABINET_VISIBLE.getI18nMemo()),

    RPOUTSTOCK_FILE_CABINET_VISIBLE(XbbRefTypeEnum.RETURNED_PURCHASE_OUTSTOCK.getCode(), ProPermissionAliasEnum.RPOUTSTOCK_FILE_CABINET_VISIBLE.getAlias(),ProPermissionAliasEnum.RPOUTSTOCK_FILE_CABINET_VISIBLE.getI18nMemo()),

    INVENTORY_FILE_CABINET_VISIBLE(XbbRefTypeEnum.INVENTORY.getCode(), ProPermissionAliasEnum.INVENTORY_FILE_CABINET_VISIBLE.getAlias(), ProPermissionAliasEnum.INVENTORY_FILE_CABINET_VISIBLE.getI18nMemo()),

    TRANSFER_FILE_CABINET_VISIBLE(XbbRefTypeEnum.TRANSFER.getCode(), ProPermissionAliasEnum.TRANSFER_FILE_CABINET_VISIBLE.getAlias(), ProPermissionAliasEnum.TRANSFER_FILE_CABINET_VISIBLE.getI18nMemo()),

    WAREHOUSE_FILE_CABINET_VISIBLE(XbbRefTypeEnum.WAREHOUSE.getCode(), ProPermissionAliasEnum.WAREHOUSE_FILE_CABINET_VISIBLE.getAlias(), ProPermissionAliasEnum.WAREHOUSE_FILE_CABINET_VISIBLE.getI18nMemo()),

    RE_PURCHASE_FILE_CABINET_VISIBLE(XbbRefTypeEnum.RETURNED_PURCHASE.getCode(), ProPermissionAliasEnum.RE_PURCHASE_FILE_CABINET_VISIBLE.getAlias(), ProPermissionAliasEnum.RE_PURCHASE_FILE_CABINET_VISIBLE.getI18nMemo()),

    ASSEMBLE_FILE_CABINET_VISIBLE(XbbRefTypeEnum.ASSEMBLE.getCode(), ProPermissionAliasEnum.ASSEMBLE_FILE_CABINET_VISIBLE.getAlias(), ProPermissionAliasEnum.ASSEMBLE_FILE_CABINET_VISIBLE.getI18nMemo()),

    INVOICE_FILE_CABINET_VISIBLE(XbbRefTypeEnum.INVOICE.getCode(), ProPermissionAliasEnum.INVOICE_FILE_CABINET_VISIBLE.getAlias(), ProPermissionAliasEnum.INVOICE_FILE_CABINET_VISIBLE.getI18nMemo()),

    WORK_ORDER_FILE_CABINET_VISIBLE(XbbRefTypeEnum.WORK_ORDER.getCode(), ProPermissionAliasEnum.WORK_ORDER_FILE_CABINET_VISIBLE.getAlias(), ProPermissionAliasEnum.WORK_ORDER_FILE_CABINET_VISIBLE.getI18nMemo()),

    BOM_FILE_CABINET_VISIBLE(XbbRefTypeEnum.BOM_BILL.getCode(), ProPermissionAliasEnum.BOM_FILE_CABINET_VISIBLE.getAlias(), ProPermissionAliasEnum.BOM_FILE_CABINET_VISIBLE.getI18nMemo()),

    PRO_ORDER_FILE_CABINET_VISIBLE(XbbRefTypeEnum.PRODUCTION_ORDER.getCode(), ProPermissionAliasEnum.PRO_ORDER_FILE_CABINET_VISIBLE.getAlias(), ProPermissionAliasEnum.PRO_ORDER_FILE_CABINET_VISIBLE.getI18nMemo()),

    COM_PLAN_FILE_CABINET_VISIBLE(XbbRefTypeEnum.COMMUNICATE_PLAN.getCode(), ProPermissionAliasEnum.COM_PLAN_FILE_CABINET_VISIBLE.getAlias(), ProPermissionAliasEnum.COM_PLAN_FILE_CABINET_VISIBLE.getI18nMemo()),

    PRODUCT_FILE_CABINET_VISIBLE(XbbRefTypeEnum.PRODUCT.getCode(), ProPermissionAliasEnum.PRODUCT_FILE_CABINET_VISIBLE.getAlias(), ProPermissionAliasEnum.PRODUCT_FILE_CABINET_VISIBLE.getI18nMemo()),

    PAY_PLAN_FILE_CABINET_VISIBLE(XbbRefTypeEnum.PAY_PLAN.getCode(), ProPermissionAliasEnum.PAY_PLAN_FILE_CABINET_VISIBLE.getAlias(), ProPermissionAliasEnum.PAY_PLAN_FILE_CABINET_VISIBLE.getI18nMemo()),

    PAYMENT_FILE_CABINET_VISIBLE(XbbRefTypeEnum.PAYMENT.getCode(), ProPermissionAliasEnum.PAYMENT_FILE_CABINET_VISIBLE.getAlias(), ProPermissionAliasEnum.PAYMENT_FILE_CABINET_VISIBLE.getI18nMemo()),

    SUP_CONTACT_FILE_CABINET_VISIBLE(XbbRefTypeEnum.SUPPLIER_CONTACT.getCode(), ProPermissionAliasEnum.SUP_CONTACT_FILE_CABINET_VISIBLE.getAlias(), ProPermissionAliasEnum.SUP_CONTACT_FILE_CABINET_VISIBLE.getI18nMemo()),

    SUP_COM_FILE_CABINET_VISIBLE(XbbRefTypeEnum.SUPPLIER_COMMUNICATE.getCode(), ProPermissionAliasEnum.SUP_COM_FILE_CABINET_VISIBLE.getAlias(), ProPermissionAliasEnum.SUP_COM_FILE_CABINET_VISIBLE.getI18nMemo()),

    REFUND_FILE_CABINET_VISIBLE(XbbRefTypeEnum.REFUND.getCode(), ProPermissionAliasEnum.REFUND_FILE_CABINET_VISIBLE.getAlias(), ProPermissionAliasEnum.REFUND_FILE_CABINET_VISIBLE.getI18nMemo()),

    QUOTATION_FILE_CABINET_VISIBLE(XbbRefTypeEnum.QUOTATION.getCode(), ProPermissionAliasEnum.QUOTATION_FILE_CABINET_VISIBLE.getAlias(),ProPermissionAliasEnum.QUOTATION_FILE_CABINET_VISIBLE.getI18nMemo()),

    PAY_SHEET_FILE_CABINET_VISIBLE(XbbRefTypeEnum.PAY_SHEET.getCode(), ProPermissionAliasEnum.PAY_SHEET_FILE_CABINET_VISIBLE.getAlias(),ProPermissionAliasEnum.PAY_SHEET_FILE_CABINET_VISIBLE.getI18nMemo()),

    PAYMENT_SHEET_FILE_CABINET_VISIBLE(XbbRefTypeEnum.PAYMENT_SHEET.getCode(), ProPermissionAliasEnum.PAYMENT_SHEET_FILE_CABINET_VISIBLE.getAlias(),ProPermissionAliasEnum.PAYMENT_SHEET_FILE_CABINET_VISIBLE.getI18nMemo()),

    PUR_INVOICE_FILE_CABINET_VISIBLE(XbbRefTypeEnum.PURCHASE_INVOICE.getCode(), ProPermissionAliasEnum.PUR_INVOICE_FILE_CABINET_VISIBLE.getAlias(),ProPermissionAliasEnum.PUR_INVOICE_FILE_CABINET_VISIBLE.getI18nMemo()),

    CLUE_FILE_CABINET_VISIBLE(XbbRefTypeEnum.CLUE.getCode(), ProPermissionAliasEnum.CLUE_FILE_CABINET_VISIBLE.getAlias(),ProPermissionAliasEnum.CLUE_FILE_CABINET_VISIBLE.getI18nMemo()),

    MA_ACTIVITY_FILE_CABINET_VISIBLE(XbbRefTypeEnum.MARKET_ACTIVITY.getCode(), ProPermissionAliasEnum.MA_ACTIVITY_FILE_CABINET_VISIBLE.getAlias(),ProPermissionAliasEnum.MA_ACTIVITY_FILE_CABINET_VISIBLE.getI18nMemo()),

    ;

    private Integer code;

    private String alias;

    private String memo;

    FileCabinetVisiblePermissionEnum(Integer code, String alias, String memo) {
        this.code = code;
        this.alias = alias;
        this.memo = memo;
    }

    public static FileCabinetVisiblePermissionEnum getByCode(Integer businessType) {
        for (FileCabinetVisiblePermissionEnum item: values()) {
            if (Objects.equals(item.getCode(), businessType)) {
                return item;
            }
        }
        return null;
    }

    public String getMemo() {
        return I18nMessageUtil.getMessage(memo);
    }
}
